<?php
	$sql="select groupName from {$this->prename}played_group where id=?";
	$groupName=$this->getValue($sql, $this->groupId);

	$sql="select id, name, playedTpl, enable  from {$this->prename}played where enable=1 and groupId=? order by sort";
	$playeds=$this->getRows($sql, $this->groupId);
	if(!$playeds) {echo '<div style="height:150px;margin-top:50px;text-align:center;color:#f00">暂无玩法</div>';return;} 
	if(!$this->played) $this->played=$playeds[0]['id'];
	
?>
<div class="game-btn2">
	<?php
		if($playeds) foreach($playeds as $played){
			if($this->played==$played['id']){
				$tpl=$played['playedTpl'];
			}
			if($played['enable']){
	?>
	<div class="ul-li<?=($played['id']==$this->played)?' current':''?>"><a data_id="<?=$played['id']?>" href="/index.php/index/played/<?=$this->type?>/<?=$played['id']?>"><?=$played['name']?></a></div>
	<? }} ?>
    <div class="clear"></div>
</div>
<div id="game-helptips"><?php $this->display("index/inc_game_tips.php", 0 ,$this->played); ?></div>
<div class="num-table" id="num-select">
<?php 
	if(!$played['enable']) {echo '<div style="height:100px;text-align:center;color:#f00">暂无玩法</div>';return;} 
	
	$this->display("index/game-played/$tpl.php"); ?>
</div>

<script type="text/javascript">

	$(function(){
		
		domAction();
		/*
		$(".game-btn a").on('click',function(e){
			//alert(4);
			//domAction();
		});
		*/
		
		$('.ui-betting-title').bind('touchend', function () {
			event.preventDefault();
			
			$('.beet-tips').toggle();
			$('.beet-rig').hide();
		});
		

		$('.bett-head').click(function(){
			$('.beet-tips').hide();
			$('.beet-rig').toggle();
			return false;
		});
		
		$('.beet-tips').bind("click",function(){
			//console.log($(this).css('display'));
			if($(this).css('display')!='none'){
				event.stopPropagation();
			}
		});
		
		$("#reveal-left").click(function(){
			window.location.href="/index.php";
		});

	});
	
	
	function domAction(){
		
		//节点操作
		$(".num-table .pp .title").wrap("<div class=\"lot-number-left\"></div>");
		$(".num-table .pp>input.code").wrap("<div class=\"specific-cell-o\"></div>");
		
		$(".num-table .pp").wrapInner("<div class=\"lot-number-right\"></div>");
		var _titDom;
		$(".num-table .pp .lot-number-right").each(function(){
			//$(".num-table .pp .specific-cell-o").wrapAll("<div class=\"lot-number-right\"></div>");
			_titDom = $(this).children(":first");
			_titDom.remove();
			//alert(_titDom);
			$(this).before(_titDom);
			
		});
		

		
	}
</script>